import { Component, OnInit } from '@angular/core';
import {AbstractControl, FormBuilder, FormGroup, Validators} from '@angular/forms';


// @ts-ignore
import {ModalController, NavController, Platform} from '@ionic/angular';

@Component({
	selector: 'app-login',
	templateUrl: './login.page.html',
	styleUrls: ['./login.page.scss'],
})
export class LoginPage implements OnInit {
	loginForm: FormGroup;
    loginIdControl: AbstractControl;
    passwordControl: AbstractControl;
	phoneNumber;
    password;
	constructor(private formBuilder:FormBuilder,private nav: NavController) { 
		this.did();
	}

	did(){
		this.loginForm = this.formBuilder.group({
            loginId: [this.phoneNumber, Validators.required],
            password: [this.password, [Validators.required, Validators.minLength(6)]],
        });
	}

	ngOnInit() {
	}

	onFocus(evt){

	}

	onBlur(evt){

	}
	change(){

	}

	check(){
		this.nav.navigateRoot('/home', { animated: true, animationDirection: 'forward' });
	}

}
